﻿/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn， 注意去除风格后缀和大小写，如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward，如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  { path: '/', redirect: '/welcome' },
  { path: '/user', layout: false, routes: [{ name: 'login', path: '/user/login', component: './User/Login' }] },
  { path: '/welcome', name: '首页', icon: 'crown', component: './Welcome' },
  {
    name: '获客管理',
    icon: 'SolutionOutlined',
    path: '/marketing',
    routes: [
      { path: '/marketing', redirect: '/marketing/customer', access: 'hasCustomerPerm' },
      {
        name: '客资录入',
        icon: 'UserOutlined',
        path: '/marketing/customer',
        component: './Customer',
        access: 'hasCustomerPerm',
      },
      {
        name: '订单录入',
        icon: 'BarsOutlined',
        path: '/marketing/order',
        component: './Order',
        access: 'hasOrderPerm',
      },
      // {name: "客资渠道", icon: "ImportOutlined", path: "/marketing/channel", component: "./CustomerChannel",access: "hasCustomerChannelPerm"},
      // {name: "套系", icon: "ShoppingOutlined", path: "/marketing/goods", component: "./Goods",access: "hasGoodsPerm"},
      {
        name: '目标设置',
        icon: 'ShoppingOutlined',
        path: '/marketing/target',
        component: './Target',
        access: 'hasTargetPerm',
      },
      {
        path: '/marketing/setting',
        icon: 'setting',
        name: '营销设置',
        component: './Setting',
        access: 'hasSettingPerm',
      },
      {
        path: '/marketing/deliverList',
        icon: 'setting',
        name: '投放记录',
        component: './DeliverLog',
        access: 'hasSettingPerm',
      },
      { path: '/marketing/report', name: '数据报表', icon: 'crown', component: './Statistics', access: 'hasAdminRole' },
      { path: '/marketing/statistics', name: '数据图表', icon: 'crown', component: './Home', access: 'hasAdminRole' },
    ],
  },
  {
    name: '营销管理',
    icon: 'SolutionOutlined',
    path: '/mp',
    routes: [
      { path: '/mp', redirect: '/mp/info', access: 'hasMpPerm' },

      { path: '/mp/info', icon: 'UserOutlined', name: '公众号', component: './Mp', access: 'hasMpPerm' },
      { path: '/mp/tag', icon: 'UserOutlined', name: '用户标签', component: './TagManage', access: 'hasMpPerm' },
      {
        path: '/mp/qrCode',
        icon: 'UserOutlined',
        name: '二维码管理',
        component: './QrCodeManage',
        access: 'hasMpPerm',
      },
      { path: '/mp/design', icon: 'UserOutlined', name: '页面搭建', component: './PageDesign', access: 'hasMpPerm' },
      // {path: "/mp/createMiniapp", name: "创建小程序", component: "./CreateMiniapp",access: 'hasInfraFilePerm'},
      {
        path: '/mp/autoReply',
        icon: 'SolutionOutlined',
        name: '自动回复',
        component: './AutoReply',
        access: 'hasAutoReplyPerm',
      },
      {
        path: '/mp/authResult',
        component: './AuthResult',
        access: 'hasAutoReplyPerm',
      },
      {
        name: '粉丝节',
        icon: 'SolutionOutlined',
        path: '/mp/bh',
        routes: [
          { path: '/mp/bh', redirect: '/mp/bh/activity', access: 'hasActivityPerm' },
          { path: '/mp/bh/activity', name: '活动管理', component: './Activity', access: 'hasActivityPerm' },
          { path: '/mp/bh/edit', name: '活动设置', component: './ActivityEdit', access: 'hasActivityPerm' },
          {
            path: '/mp/bh/activityCreate',
            name: '创建活动',
            component: './ActivityCreate',
            access: 'hasActivityPerm',
            hideInMenu: true,
          },
        ],
      },
      {
        name: '抢档',
        icon: 'SolutionOutlined',
        path: '/mp/schedule',
        component: './ScheduleProject',
      },
      {
        name: '主题风格',
        icon: 'SkinOutlined',
        path: '/mp/themstyle',
        component: './ThemeStyle',
      },
      //   { path: '/mp/themstyle', icon: 'UserOutlined', name: '主题风格', component: './ThemStyle', access: 'hasMpPerm' },
    ],
  },
  {
    name: '客服中心',
    icon: 'SolutionOutlined',
    path: '/kf',
    component: './KF',
  },
  {
    name: '系统设置',
    icon: 'setting',
    path: '/setting',
    routes: [
      { path: '/setting', redirect: '/setting/system_user', access: 'hasUserPerm' },
      {
        name: '用户管理',
        icon: 'UserOutlined',
        path: '/setting/system_user',
        component: './SystemUser',
        access: 'hasUserPerm',
      },
      {
        name: '角色管理',
        icon: 'UsergroupAddOutlined',
        path: '/setting/system_role',
        component: './SystemRole',
        access: 'hasRolePerm',
      },
      {
        name: '代码生成器',
        icon: 'AppstoreAddOutlined',
        path: '/setting/generate',
        component: './Generate',
        access: 'hasDeveloperRole',
      },
      {
        name: '字典管理',
        icon: 'BookOutlined',
        path: '/setting/dict',
        component: './DictType',
        access: 'hasDictTypePerm',
      },
      {
        path: '/setting/notify',
        icon: 'BookOutlined',
        name: '通知',
        component: './Notify',
        access: 'hasNotifyPerm',
      },
      {
        path: '/setting/socialUser',
        icon: 'UserOutlined',
        name: '社交用户',
        component: './SocialUser',
        access: 'hasSocialUserPerm',
      },
      {
        path: '/setting/infraFile',
        icon: 'UserOutlined',
        name: '文件管理',
        component: './InfraFile',
        access: 'hasInfraFilePerm',
      },
      {
        path: '/setting/tenant',
        icon: 'UserOutlined',
        name: '辅导店管理',
        component: './Tenant',
        access: 'hasInfraFilePerm',
      },
      {
        path: '/setting/demo',
        icon: 'UserOutlined',
        name: '测试页面',
        component: './Demo',
        access: 'hasInfraFilePerm',
      },
      {
        path: '/setting/collectionRecord',
        icon: 'UserOutlined',
        name: '领取界面',
        component: './CollectionRecord',
        // access: 'hasInfraFilePerm',
      },
      {
        path: '/setting/usercenter',
        icon: 'UserOutlined',
        name: '个人中心',
        component: './UserCenter',
        // access: 'hasInfraFilePerm',
      },
      {
        path: '/setting/communicate',
        icon: 'UserOutlined',
        name: '聊天窗口',
        component: './Communicate',
        // access: 'hasInfraFilePerm',
      },
    ],
  },
  { path: '*', layout: false, component: './404' },
  // { path: '/account/usercenter', name: '个人中心', icon: 'crown', component: './UserCenter' },
]
